<?php

/* * 
 * 资讯
 */
namespace Common\Model;
use Think\Model;
class SociatyMemberModel extends BaseModel {


    public function queryForList($page=null, $map=null) {
        $list = $this->alias("m")
                ->join("left join __CUSTOMER__ c on c.customer_id = m.customer_id")
                ->where(getWhereSqlByMap($map))
                ->order("m.create_time desc")
                ->limit($page->firstRow . ',' . $page->listRows)
                ->field("m.*,c.nickname")
                ->select();

        return $list;

    }

    public function getListCount($map = null) {

        $count = $this->alias("m")
            ->join("left join __CUSTOMER__ c on c.customer_id = m.customer_id")
            ->where(getWhereSqlByMap($map))
            ->count();

        return $count;
    }

}

